<%-- 
    Document   : Search
    Created on : Sep 4, 2013, 2:06:24 PM
    Author     : ChauAnh
--%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Set"%>
<%@page import="java.util.HashMap"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Search</title>
    </head>
    <body id="search">
        <div align="center">
            <div align="center" style="height: auto; width: 800px">
                <jsp:include page="master.jsp" flush="true"/>                
            </div>            
            <form action="SearchProcess">
                <div align="center" style="height: 100%; width: 800px">     
                    <table style="width: 100%; margin-top: 20px;">
                        <tr>
                            <td style="height: 40px;">
                                <%
                                    if (request.getSession().getAttribute("searchValue") == null) {
                                %>
                                <div style="float: left">
                                    <input type="text" name="txtSearchValue" value="" class="gwt-TextBox-Search" />
                                </div>

                                <%                } else { 
                                        String value = request.getSession().getAttribute("searchValue").toString();

                                %>
                                <div style="float: left">
                                    <input type="text" name="txtSearchValue" value="<% out.println(value); %>" class="gwt-TextBox-Search" />
                                </div>
                                <%
                                    }
                                %>

                                <div style="float: left">
                                    <select name="cbSearchBy" class="gwt-Combobox-Search">
                                        <option>Member Id</option>
                                        <option>Caste</option>
                                    </select>
                                </div>
                                <div style="float: left">
                                    <input type="submit" value="Find" class="gwt-Button-Search"/>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <%
                                    if (request.getSession().getAttribute("listFindCandidate") != null) {
                                        HashMap listRMCandidate = (HashMap) request.getSession().getAttribute("listFindCandidate");
                                        Set keyRMCandidate = listRMCandidate.keySet();
                                        Iterator itr = keyRMCandidate.iterator();
                                        while (itr.hasNext()) {
                                            Object keyid = itr.next();
                                            HashMap hm = (HashMap) listRMCandidate.get(keyid);
                                %>
                                <div id="framSendRequest">
                                    <table style="height: 200px; width: 394px; border-collapse: collapse;">
                                        <tr>                        
                                            <td align="center" style="height: 200px; width: 200px; background-color: #A80037" class="text-nomarl-while">
                                                <h4 style="margin-bottom: 30px; margin-top: 10px"><%=hm.get("first_name") + " " + hm.get("middle_name")%></h4> <br>
                                                <h2 style="margin-bottom: 15px;"><%=hm.get("last_name")%></h2>
                                                <input type="button" style="margin-top: 41px; margin-left: 100px" value="<fmt:message key="framesendrequest.seemore"/>" class="buttonSendRequest" onclick="window.location.href = 'CandidateProfileDetails?username=<%=hm.get("username")%>'"/>
                                            </td>
                                            <td rowspan="2" style="height: 200px; width: 194px">                           
                                                <img src= 'avatar/<%=hm.get("avatar")%>' width='194px' height='200px' border='0' alt='User'/>                           
                                            </td>
                                        </tr>                        
                                    </table>            
                                </div>
                                <%
                                        }
                                    }
                                %>
                            </td>
                        </tr>
                    </table>
                </div>
            </form>
        </div>
    </body>
</html>
